package com.xinsilu.hospital.mapper;



import com.xinsilu.hospital.entity.AuthsysResources;

import static org.apache.ibatis.jdbc.SqlBuilder.*;

public class AuthSysResourcesSqlProvider {

    public String insertSelective(AuthsysResources record) {
        BEGIN();
        INSERT_INTO("authsys_resources");
        
        if (record.getRscId() != null) {
            VALUES("rsc_id", "#{rscId,jdbcType=INTEGER}");
        }
        
        if (record.getRscName() != null) {
            VALUES("rsc_name", "#{rscName,jdbcType=VARCHAR}");
        }
        
        if (record.getRscUrl() != null) {
            VALUES("rsc_url", "#{rscUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getRscDesc() != null) {
            VALUES("rsc_desc", "#{rscDesc,jdbcType=VARCHAR}");
        }
        
        return SQL();
    }

    public String updateByPrimaryKeySelective(AuthsysResources record) {
        BEGIN();
        UPDATE("authsys_resources");
        
        if (record.getRscName() != null) {
            SET("rsc_name = #{rscName,jdbcType=VARCHAR}");
        }
        
        if (record.getRscUrl() != null) {
            SET("rsc_url = #{rscUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getRscDesc() != null) {
            SET("rsc_desc = #{rscDesc,jdbcType=VARCHAR}");
        }
        
        WHERE("rsc_id = #{rscId,jdbcType=INTEGER}");
        
        return SQL();
    }
}